home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Software of the Month Club / Amiga General Interest Volume 222 (1995)(SOMC)(Disk 4 of y)[SMCxxxC30Ix].zip / Amiga General Interest Volume 222 (1995)(SOMC)(Disk 4 of y)[SMCxxxC30Ix].adf / Install < prev    next >
Text File  |  1995-08-16  |  13KB  |  645 lines

  1. ; ImageStudio Installer Utility
  2. ;
  3. ; This script is Copyright ©1995 Andy Dean and Graham Dean
  4. ;
  5.  
  6. (
  7.     ; Ask where to install it...
  8.  
  9.     (set destdir
  10.         (askdir
  11.             (prompt "Select where you would like to install "
  12.                 "ImageStudio. A drawer called 'ImageStudio' will "
  13.                 "be created here.")
  14.             (help "ImageStudio and all necessary files will be "
  15.                 "installed in the directory of your choice. You "
  16.                 "may wish to create a new directory for "
  17.                 "ImageStudio by using the 'Make New Drawer' "
  18.                 "gadget.\n\n"
  19.                 "You may install this version over your existing "
  20.                 "version of ImageStudio, but you will loose your "
  21.                 "current preference settings and some of your "
  22.                 "files may be overwritten with more recent "
  23.                 "versions. This may be undesirable if you have "
  24.                 "customised your 'Blank_isrx' file for example.")
  25.             (default @default-dest)
  26.             (disk)
  27.         )
  28.     )
  29.  
  30.     (set destdir
  31.         (tackon destdir "ImageStudio")
  32.     )
  33.  
  34.     (set @default-dest destdir)
  35.  
  36.     ; See whether this directory exists, if so warn the user
  37.  
  38.     (if (exists @default-dest) 
  39.         (
  40.             (if (= 0 (askbool
  41.                     (prompt "The 'ImageStudio' directory "
  42.                         "already exists, overwrite?")
  43.                     (help "You may stop the install to "
  44.                         "avoid overwriting your current "
  45.                         "version of ImageStudio.\n\n"
  46.                         "Continuing the install will "
  47.                         "overwrite your current files "
  48.                         "and you will loose your current "
  49.                         "preferences.")
  50.                     (choices "Yes" "Quit")
  51.                 ))
  52.  
  53.                 (
  54.  
  55.                 ; User wishes to quit
  56.  
  57.                 (exit (quiet))
  58.                 )
  59.  
  60.             )
  61.         )
  62.     )
  63.  
  64.     (message "ImageStudio will be installed in " @default-dest)
  65.  
  66.     ; Set up decompressor to work with
  67.  
  68.     (complete 0)
  69.  
  70.     (working "Setting up files...")
  71.  
  72.     (copyfiles
  73.         (source ("ImageStudio_1:"))
  74.         (dest ("ram:"))
  75.         (choices "LX" "pcefis")
  76.     )
  77.  
  78.     (working "Installing ImageStudio Program...")
  79.  
  80.     ; Create the directory if it doesn't exist
  81.  
  82.     (if (= 0 (exists @default-dest))
  83.         (
  84.             (makedir @default-dest
  85.                 (prompt "Creating 'ImageStudio' directory")
  86.                 (infos)
  87.             )
  88.         )
  89.     )
  90.  
  91.     ; Shall we install the 68020 version ?
  92.  
  93.     (set cpuversion
  94.         (askchoice
  95.             (prompt "Choose which version of ImageStudio to install "
  96.                 "based on your processor.")
  97.             (help "If you are running an Amiga A500, A600 or "
  98.                 "unexpanded A1500 or A2000 you should run the "
  99.                 "68000 version of ImageStudio.\n\n"
  100.                 "Users of Amiga A1200, A3000, A4000s or any of the "
  101.                 "above machines which have an accelerator card "
  102.                 "should use the 68020+ version of ImageStudio "
  103.                 "for increased performance.")
  104.             (choices "68000" "68020+")
  105.         )
  106.     )
  107.  
  108.     ; Set up the versions to install based on the CPU chosen
  109.  
  110.     (if (= 0 cpuversion)
  111.         (
  112.             (set cpu "000")
  113.         )
  114.  
  115.         (
  116.             (set cpu "020")
  117.         )
  118.     )
  119.  
  120.     (working "Decompressing ImageStudio executable...")
  121.  
  122.     (run ("ram:pcefis ImageStudio_1:ImageStudio%s.lha \"%s\"" cpu
  123.                 @default-dest))
  124.  
  125.     ; Install UnCrash
  126.  
  127.     (copyfiles
  128.         (source "ImageStudio_1:UnCrash")
  129.         (dest @default-dest)
  130.     )
  131.  
  132.     ; Install convolution filters
  133.  
  134.     (complete 30)
  135.  
  136.     (set convolvedir (tackon @default-dest "Convolves"))
  137.     (set doconvolve 1)
  138.  
  139.     (if (= 0 (exists convolvedir))
  140.         (
  141.             (makedir convolvedir
  142.                 (prompt "Creating 'Convolves' directory")
  143.                 (infos)
  144.             )
  145.         )
  146.  
  147.         ; Warn user about overwriting existing Convolves
  148.  
  149.         (
  150.             (if (askbool
  151.                 (prompt "Existing 'Convolves' directory found. "
  152.                     "Overwrite existing convolution filters?")
  153.                 (help "If you don't wish to overwrite your "
  154.                     "current convolution filters, skip this "
  155.                     "part of the installation process.")
  156.                 (choices "Yes" "Skip this part")
  157.                 )
  158.  
  159.                 ; If chosen overwrite
  160.  
  161.                 (
  162.                     (set doconvolve 1)
  163.                 )
  164.  
  165.                 ; If chosen skippy
  166.  
  167.                 (
  168.                     (set doconvolve 0)
  169.                 )
  170.             )
  171.         )
  172.     )
  173.  
  174.     (if doconvolve
  175.         (
  176.             (working "Decompressing convolution filters...")
  177.  
  178.             (run ("ram:pcefis ImageStudio_1:Convolves.lha \"%s\""
  179.                 convolvedir))
  180.         )
  181.     )
  182.  
  183.     ; Install palettes
  184.  
  185.     (complete 40)
  186.  
  187.     (set palettesdir (tackon @default-dest "Palettes"))
  188.     (set dopalettes 1)
  189.  
  190.     (if (= 0 (exists palettesdir))
  191.         (
  192.             (makedir palettesdir
  193.                 (prompt "Creating 'Palettes' directory")
  194.                 (infos)
  195.             )
  196.         )
  197.  
  198.         ; Warn user about overwriting existing Palettes
  199.  
  200.         (
  201.             (if (askbool
  202.                 (prompt "Existing 'Palettes' directory found. "
  203.                     "Overwrite existing palettes?")
  204.                 (help "If you don't wish to overwrite your "
  205.                     "current palettes, skip this "
  206.                     "part of the installation process.")
  207.                 (choices "Yes" "Skip this part")
  208.                 )
  209.  
  210.                 ; If chosen overwrite
  211.  
  212.                 (
  213.                     (set dopalettes 1)
  214.                 )
  215.  
  216.                 ; If chosen skippy
  217.  
  218.                 (
  219.                     (set dopalettes 0)
  220.                 )
  221.             )
  222.         )
  223.     )
  224.  
  225.     (if dopalettes
  226.         (
  227.             (working "Decompressing palettes...")
  228.  
  229.             (run ("ram:pcefis ImageStudio_1:Palettes.lha \"%s\""
  230.                 palettesdir))
  231.         )
  232.     )
  233.  
  234.     ; Install ARexx scripts
  235.  
  236.     (complete 45)
  237.  
  238.     (set rexxdir (tackon @default-dest "Rexx"))
  239.     (set dorexx 1)
  240.  
  241.     (if (= 0 (exists rexxdir))
  242.         (
  243.             (makedir rexxdir
  244.                 (prompt "Creating 'Rexx' directory")
  245.                 (infos)
  246.             )
  247.         )
  248.  
  249.         ; Warn user about overwriting existing Rexx scripts
  250.  
  251.         (
  252.             (if (askbool
  253.                 (prompt "Existing 'Rexx' directory found. "
  254.                     "Overwrite existing convolution filters?")
  255.                 (help "If you don't wish to overwrite your "
  256.                     "current ARexx scripts, skip this "
  257.                     "part of the installation process.")
  258.                 (choices "Yes" "Skip this part")
  259.                 )
  260.  
  261.                 ; If chosen overwrite
  262.  
  263.                 (
  264.                     (set dorexx 1)
  265.                 )
  266.  
  267.                 ; If chosen skippy
  268.  
  269.                 (
  270.                     (set dorexx 0)
  271.                 )
  272.             )
  273.         )
  274.     )
  275.  
  276.     (if dorexx
  277.         (
  278.             (working "Decompressing ARexx scripts...")
  279.  
  280.             (run ("ram:pcefis ImageStudio_1:Rexx.lha \"%s\""
  281.                 rexxdir))
  282.         )
  283.     )
  284.  
  285.     ; Install IO modules
  286.  
  287.     (complete 50)
  288.  
  289.     (set modulesdir (tackon @default-dest "Modules"))
  290.     (set domodules 1)
  291.  
  292.     (set iodir (tackon modulesdir "IO"))
  293.     (set doio 1)
  294.  
  295.     (if (= 0 (exists modulesdir))
  296.         (
  297.             (makedir modulesdir
  298.                 (prompt "Creating 'Modules' directory")
  299.                 (infos)
  300.             )
  301.         )
  302.  
  303.         ; Warn user about overwriting existing modules
  304.  
  305.         (
  306.             (if (askbool
  307.                 (prompt "Existing 'Modules' directory found. "
  308.                     "Overwrite existing modules?")
  309.                 (help "If you don't wish to overwrite your "
  310.                     "current modules, skip this "
  311.                     "part of the installation process.")
  312.                 (choices "Yes" "Skip this part")
  313.                 )
  314.  
  315.                 ; If chosen overwrite
  316.  
  317.                 (
  318.                     (set domodules 1)
  319.                 )
  320.  
  321.                 ; If chosen skippy
  322.  
  323.                 (
  324.                     (set domodules 0)
  325.                 )
  326.             )
  327.         )
  328.     )
  329.  
  330.     (if (= 0 (exists iodir))
  331.         (
  332.             (makedir iodir
  333.                 (prompt "Creating 'IO' directory")
  334.                 (infos)
  335.             )
  336.         )
  337.  
  338.         ; Warn user about overwriting existing IO modules
  339.  
  340.         (
  341.             (if (askbool
  342.                 (prompt "Existing 'IO' directory found. "
  343.                     "Overwrite existing IO modules?")
  344.                 (help "If you don't wish to overwrite your "
  345.                     "current IO modules, skip this "
  346.                     "part of the installation process.")
  347.                 (choices "Yes" "Skip this part")
  348.                 )
  349.  
  350.                 ; If chosen overwrite
  351.  
  352.                 (
  353.                     (set doio 1)
  354.                 )
  355.  
  356.                 ; If chosen skippy
  357.  
  358.                 (
  359.                     (set doio 0)
  360.                 )
  361.             )
  362.         )
  363.     )
  364.  
  365.     (if doio
  366.         (
  367.             (working "Decompressing IO modules...")
  368.  
  369.             (run ("ram:pcefis ImageStudio_1:IO%s.lha \"%s\"" cpu
  370.                 iodir))
  371.         )
  372.     )
  373.  
  374.     ; Install View modules
  375.  
  376.     (complete 55)
  377.  
  378.     (set viewdir (tackon modulesdir "View"))
  379.     (set doview 1)
  380.  
  381.     (if (= 0 (exists viewdir))
  382.         (
  383.             (makedir iodir
  384.                 (prompt "Creating 'View' directory")
  385.                 (infos)
  386.             )
  387.         )
  388.  
  389.         ; Warn user about overwriting existing View modules
  390.  
  391.         (
  392.             (if (askbool
  393.                 (prompt "Existing 'View' directory found. "
  394.                     "Overwrite existing View modules?")
  395.                 (help "If you don't wish to overwrite your "
  396.                     "current IO modules, skip this "
  397.                     "part of the installation process.")
  398.                 (choices "Yes" "Skip this part")
  399.                 )
  400.  
  401.                 ; If chosen overwrite
  402.  
  403.                 (
  404.                     (set doview 1)
  405.                 )
  406.  
  407.                 ; If chosen skippy
  408.  
  409.                 (
  410.                     (set doview 0)
  411.                 )
  412.             )
  413.         )
  414.     )
  415.  
  416.     (if doview
  417.         (
  418.             (working "Decompressing View modules...")
  419.  
  420.             (run ("ram:pcefis ImageStudio_1:View%s.lha \"%s\"" cpu
  421.                 viewdir))
  422.         )
  423.     )
  424.  
  425.     ; Copy the AmigaGuide.library if needed
  426.  
  427.     (complete 60)
  428.  
  429.     (working "Checking amigaguide.library version...")
  430.  
  431.     (copylib
  432.         (prompt "Copying amigaguide library to LIBS: directory...")
  433.         (help "The amigaguide.library is needed for online help. "
  434.             "Users of Workbench3.0 and above will have a more recent "
  435.             "version of this library and so can skip this part "
  436.             "of the installation.")
  437.         (source "ImageStudio_1:libs/amigaguide.library")
  438.         (dest "LIBS:")
  439.         (confirm)
  440.     )
  441.  
  442.     ; Copy keyfile if it exists
  443.  
  444.     (if (exists "ImageStudio_1:ImageStudio.keyfile")
  445.         (
  446.             (copyfiles
  447.                 (source "ImageStudio_1:ImageStudio.keyfile")
  448.                 (dest @default-dest)
  449.             )
  450.  
  451.             (set foundkeyfile (""))
  452.         )
  453.  
  454.         ; Else, note we didn't find one
  455.  
  456.         (
  457.             (set foundkeyfile (cat "No keyfile was found during "
  458.                 "installation. If you are a registered user make "
  459.                 "sure that you create a keyfile by selecting the "
  460.                 "'Create keyfile' option in the 'Project' menu "
  461.                 "of this version of ImageStudio. For more details "
  462.                 "see the 'Upgrading from v1.x.x' section in the "
  463.                 "'Introduction' of the manual."))
  464.         )
  465.     )
  466.  
  467.     ; Ask user what documentation the user wishes
  468.  
  469.     (set docchoice
  470.         (askoptions
  471.             (prompt "Which formats of documentation would you like "
  472.                 "installing in your 'Docs' directory?")
  473.             (help   "ImageStudio.txt is the ASCII (plain text) "
  474.                 "documentation file.\n\n"
  475.                 "ImageStudio.guide documentation is required for "
  476.                 "online help.\n\n"
  477.                 "ImageStudio.ps is the documentation in PostScript "
  478.                 "format.\n\n"
  479.                 "ImageStudio.dvi is for use with the Amiga TeX "
  480.                 "package.")
  481.             (choices "ImageStudio.txt" "ImageStudio.guide"
  482.                  "ImageStudio.ps" "ImageStudio.dvi")
  483.             (default 3)
  484.         )
  485.     )
  486.  
  487.     ; Create directory if needed
  488.  
  489.     (set docsdir (tackon @default-dest "Docs"))
  490.  
  491.     (if (= 0 (exists docsdir))
  492.         (
  493.             (makedir docsdir
  494.                 (prompt "Creating 'Docs' directory")
  495.                 (infos)
  496.             )
  497.         )
  498.     )
  499.  
  500.     ; Copy the readme, history and news files into the docs directory
  501.  
  502.     (complete 70)
  503.  
  504.     (copyfiles
  505.         (source "ImageStudio_1:")
  506.         (dest docsdir)
  507.         (choices "NEWS.txt" "HISTORY.txt" "README.txt" "Award.ilbm")
  508.         (infos)
  509.     )
  510.  
  511.     ; The (assigns) parameters in the askdisk commands is deliberate
  512.     ; as the user may want to decompress the .lha distribution archives
  513.     ; into directories instead of onto disks. This just make life easier.
  514.  
  515.     ; See if we want to install the ImageStudio.txt doc
  516.  
  517.     (if (= 1 (IN docchoice 0))
  518.         (
  519.             (askdisk (dest "ImageStudio_2") (assigns)
  520.             (prompt "Please insert disk ImageStudio_2")
  521.             (help "Insert Disk 2 in any drive. You may "
  522.                 "remove Disk 1, it will not be needed again."))
  523.  
  524.             (working "Decompressing ASCII documentation...")
  525.  
  526.             (run ("ram:pcefis ImageStudio_2:DocTXT.lha \"%s\""
  527.                 docsdir))
  528.         )
  529.     )
  530.  
  531.     ; See if we want to install the ImageStudio.guide doc
  532.  
  533.     (if (= 2 (IN docchoice 1))
  534.         (
  535.             (askdisk (dest "ImageStudio_2") (assigns)
  536.             (prompt "Please insert disk ImageStudio_2")
  537.             (help "Insert Disk 2 in any drive. You may "
  538.             "remove Disk 1, it will not be needed again.") )
  539.  
  540.             (working "Decompressing AmigaGuide documentation...")
  541.  
  542.             (run ("ram:pcefis ImageStudio_2:DocGUIDE.lha \"%s\""
  543.                 docsdir))
  544.         )
  545.     )
  546.  
  547.     ; See if we want to install the ImageStudio.ps doc
  548.  
  549.     (if (= 4 (IN docchoice 2))
  550.         (
  551.             (askdisk (dest "ImageStudio_2") (assigns)
  552.             (prompt "Please insert disk ImageStudio_2")
  553.             (help "Insert Disk 2 in any drive. You may "
  554.             "remove Disk 1, it will not be needed again.") )
  555.  
  556.             (working "Decompressing PostScript documentation...")
  557.  
  558.             (run ("ram:pcefis ImageStudio_2:DocPS.lha \"%s\""
  559.                 docsdir))
  560.         )
  561.     )
  562.  
  563.     ; See if we want to install the ImageStudio.dvi doc
  564.  
  565.     (if (= 8 (IN docchoice 3))
  566.         (
  567.             (askdisk (dest "ImageStudio_2") (assigns)
  568.             (prompt "Please insert disk ImageStudio_2")
  569.             (help "Insert Disk 2 in any drive. You may "
  570.             "remove Disk 1, it will not be needed again.") )
  571.  
  572.             (working "Decompressing DVI documentation...")
  573.  
  574.             (run ("ram:pcefis ImageStudio_2:DocDVI.lha \"%s\""
  575.                 docsdir))
  576.         )
  577.     )
  578.  
  579.     ; Ask whether should install demo pictures
  580.  
  581.     (complete 90)
  582.  
  583.     (set demopics
  584.         (askbool
  585.             (prompt "Do you want the demo pictures installed?")
  586.             (help "Installing the demo pics will allow you to perform "
  587.                 "some of the tutorials given in the documentation. "
  588.                 "All the demo pictures are small enough to load "
  589.                 "into the unregistered version of ImageStudio.")
  590.             (choices "Yes" "Skip this part")
  591.         )
  592.     )
  593.  
  594.     (if demopics
  595.         (
  596.             ; Create directory if needed
  597.  
  598.             (set picsdir (tackon @default-dest "Pics"))
  599.  
  600.             (if (= 0 (exists picsdir))
  601.                 (
  602.                     (makedir picsdir
  603.                         (prompt "Creating 'Pics' directory")
  604.                         (infos)
  605.                     )
  606.                 )
  607.             )
  608.  
  609.             ; Decompress the pics files
  610.  
  611.             (askdisk (dest "ImageStudio_2") (assigns)
  612.             (prompt "Please insert disk ImageStudio_2")
  613.             (help "Insert Disk 2 in any drive. You may "
  614.             "remove Disk 1, it will not be needed again.") )
  615.  
  616.             (working "Decompressing demo pics...")
  617.  
  618.             (run ("ram:pcefis ImageStudio_2:Pics.lha \"%s\""
  619.                 picsdir))
  620.         )
  621.     )
  622.     ; Say goodbye
  623.  
  624.     (set endmessage (cat "Do not forget to set the value of the TEMPDIR "
  625.         "preference so that the virtual memory swap files can be created "
  626.         "on your hard disk instead of taking lots of RAM."
  627.         "The INTERNALVIEWER can also be changed to take advantage of "
  628.         "an AGA Amiga, or Amiga with a graphics card.\n\n"))
  629.  
  630.     (if (<> foundkeyfile "")
  631.         (
  632.             (set endmessage (cat endmessage foundkeyfile))
  633.         )
  634.     )
  635.  
  636.     (complete 100)
  637.  
  638.     (message endmessage)
  639.  
  640.     ; Cleanup
  641.  
  642.     (delete ("ram:LX"))
  643.     (delete ("ram:pcefis"))
  644. )
  645.